<html>

<head>
    <script src="/static/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/static/css/base.css"/>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="/static/js/bootstrap.min.js"></script>
    <script src="/static/js/bootstrap-table.min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap-table.min.css"/>
    <script src="/static/js/moment.min.js"></script>
    <script src="/static/js/bootstrap-datetimepicker.min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap-datetimepicker.min.css"/>
    <script src="/static/js/bootstrap-duallistbox.min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap-duallistbox.min.css"/>
</head>
<body>
    <nav class="navbar navbar-static-top">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">Beego Administrator</a>
            </div>
        
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                <li><div class="navbar-header"><a class="navbar-brand" href="#">WELCOME,{{.User}}</a></div></li>
                <li><a href="#">View Site</a></li>
                <li><a href="#">Change PWD</a></li>
                <li><a href="#">Log Out</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Manager <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                    <li><a href="#">Action</a></li>
                    <li><a href="#">Another action</a></li>
                    <li><a href="#">Something else here</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="#">Separated link</a></li>
                    </ul>
                </li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav> 

    <ol class="breadcrumb">
        <li><a href="/admin/test1">Home</a></li>
        <li><a href="/admin/table?name={{.Name}}">{{.Name}}</a></li>
        <li class="active">ADD</li>
    </ol>

    <div class="col-md-11">  
        <div class="row">
            <div class="col-xs-12 col-sm-10 col-md-offset-2">
                <h3>Add {{.Name}} </h3>
                <!-- <ul class="pager">
                    <li class="previous disabled">site administrator</li>
                    <li class="next"><a href="#">newer <span aria-hidden="true">&rarr;</span></a></li>
                </ul> -->
                <br/>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <!-- <iframe name="targetIfr" style="display:none"></iframe>  -->
                <form id="myform" class="form-horizontal" role="form" method="POST" action="/admin/add?table={{.Name}}">  
                <!-- <form id="myform" class="form-horizontal" role="form" method="POST" action="/admin/add?table={{.Name}}" target="targetIfr">   -->
                <!-- <form class="form-horizontal" role="form" id="myform">   -->
                    {{.Col| formcolumns | str2html}}
                    <!-- <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> text field </label>
                        <div class="col-sm-10">
                            <input id="form-field-1" placeholder="username" class="col-xs-10 col-sm-10" type="text">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> text field998 </label>
                        <div class="col-sm-10">
                            <input id="form-field-1" placeholder="username" class="col-xs-10 col-sm-10" type="file">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> text field </label>
                        <div class="col-sm-10">
                            <input id="form-field-1" placeholder="username" class="col-xs-10 col-sm-10" type="number">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> text field </label>
                        <div class="col-sm-10">
                            <textarea name="textarea" class="col-xs-10 col-sm-10" rows="10"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> text field </label>
                        <div class="col-sm-10">
                            男性
                            <input type="radio" checked="checked" name="sex" value="male"> 
                            女性
                            <input type="radio" name="sex" value="female">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> text field </label>
                        <div class="col-sm-10">
                            <select class="col-xs-10 col-sm-10" name="cars">
                                <option value="volvo">volvo</option>
                                <option value="saab">saab</option>
                                <option value="fiat">fiat</option>
                                <option value="audi">audi</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-top" for="duallist"> dual listbox </label>
                        <div class="col-sm-8">
                            <select multiple="multiple" size="10" name="duallistbox_demo1[]" id="duallist">
                                <option value="option1">option 1</option>
                                <option value="option2">option 2</option>
                                <option value="option3" selected="selected">option 3</option>
                                <option value="option4">option 4</option>
                                <option value="option5">option 5</option>
                                <option value="option6" selected="selected">option 6</option>
                                <option value="option7">option 7</option>
                                <option value="option8">option 8</option>
                                <option value="option9">option 9</option>
                                <option value="option0">option 10</option>
                            </select>

                            <div class="hr hr-16 hr-dotted"></div>
                        </div>
                    </div> 
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-top" for="date-timepicker1">Date/Time Picker</label>

                        <div class="col-sm-10">
                            <input id="date-timepicker1" name="dsa" type="text" class="col-xs-2 col-sm-2" />
                        </div>
                    </div> -->
                    <div class="submit-row">
                        <input type="submit" value="保存" class="default" name="_save" />
                        <input type="submit" value="保存并增加另一个" class="default" name="_addanother" />
                        <input type="submit" value="保存并继续编辑" class="default" name="_continue" />
                    </div>
                </form>
                <!-- <a href="#" style="text-decoration: none;">使用ajax提交表单数据</a> -->
            </div>
        </div>
    </div>
    <!-- <script>
        $(document).ready(function(){
            $("a").click(function(){
                 $.ajax({    
                    type:'post',        
                    url:"/admin/add?table={{.Name}}",    
                    data:$("#myform").serialize(),    
                    cache:false,    
                    dataType:'json',    
                    success:function(data){   
                        alert("请求成功");
                        alert(data);
                    }    
                });    
            });
        });
    </script>  -->
</body>
</html>